import { http } from '@/utils/axios';

export function querySelfMenus() {
  return http.request({
    url: '/v1/basic/menu/self-tree',
    method: 'GET',
  });
}

export function queryAllTree() {
  return http.request<Menu.MenuTO[]>({
    url: '/v1/basic/menu/all-tree',
    method: 'GET',
  });
}

export function create(data: Menu.MenuTO) {
  return http.request({
    url: '/v1/basic/menu/create',
    method: 'POST',
    data,
  });
}

export function modify(data: Menu.MenuTO) {
  return http.request({
    url: '/v1/basic/menu/modify',
    method: 'POST',
    data,
  });
}

export function remove(id: string) {
  return http.request({
    url: `/v1/basic/menu/${id}`,
    method: 'delete',
  });
}
